package xju_9_10.service.impl;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;
import xju_9_10.entity.User;
import xju_9_10.mapper.UserMapper;
import xju_9_10.service.UserService;
import xju_9_10.utils.MybatisUtils;

import java.util.Properties;

@Service
public class UserServiceImpl implements UserService {
    // 调用持久层
    @Override
    public User login(String username, String password) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        User user = mapper.login(username, password);
        return user;
    }
}
